<?php require_once('../Connections/juventud.php'); ?>
<?php require_once('../Connections/media.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_juventud, $juventud);
$query_rsPrograLunes = "SELECT prograID, diaProgra, horaProgra, generoProgra FROM programacion WHERE diaProgra = 'Lunes' ORDER BY horaProgra ASC";
$rsPrograLunes = mysql_query($query_rsPrograLunes, $juventud) or die(mysql_error());
$row_rsPrograLunes = mysql_fetch_assoc($rsPrograLunes);
$totalRows_rsPrograLunes = mysql_num_rows($rsPrograLunes);

mysql_select_db($database_juventud, $juventud);
$query_rsPrograMartes = "SELECT prograID, diaProgra, horaProgra, generoProgra FROM programacion WHERE diaProgra = 'Martes' ORDER BY horaProgra ASC";
$rsPrograMartes = mysql_query($query_rsPrograMartes, $juventud) or die(mysql_error());
$row_rsPrograMartes = mysql_fetch_assoc($rsPrograMartes);
$totalRows_rsPrograMartes = mysql_num_rows($rsPrograMartes);

mysql_select_db($database_juventud, $juventud);
$query_rsPrograMiercoles = "SELECT prograID, diaProgra, horaProgra, generoProgra FROM programacion WHERE diaProgra = 'Miercoles' ORDER BY horaProgra ASC";
$rsPrograMiercoles = mysql_query($query_rsPrograMiercoles, $juventud) or die(mysql_error());
$row_rsPrograMiercoles = mysql_fetch_assoc($rsPrograMiercoles);
$totalRows_rsPrograMiercoles = mysql_num_rows($rsPrograMiercoles);

mysql_select_db($database_juventud, $juventud);
$query_rsPrograJueves = "SELECT prograID, diaProgra, horaProgra, generoProgra FROM programacion WHERE diaProgra = 'Jueves' ORDER BY horaProgra ASC";
$rsPrograJueves = mysql_query($query_rsPrograJueves, $juventud) or die(mysql_error());
$row_rsPrograJueves = mysql_fetch_assoc($rsPrograJueves);
$totalRows_rsPrograJueves = mysql_num_rows($rsPrograJueves);

mysql_select_db($database_juventud, $juventud);
$query_rsPrograViernes = "SELECT prograID, diaProgra, horaProgra, generoProgra FROM programacion WHERE diaProgra = 'Viernes' ORDER BY horaProgra ASC";
$rsPrograViernes = mysql_query($query_rsPrograViernes, $juventud) or die(mysql_error());
$row_rsPrograViernes = mysql_fetch_assoc($rsPrograViernes);
$totalRows_rsPrograViernes = mysql_num_rows($rsPrograViernes);

mysql_select_db($database_juventud, $juventud);
$query_rsPrograSabado = "SELECT prograID, diaProgra, horaProgra, generoProgra FROM programacion WHERE diaProgra = 'Sabado' ORDER BY horaProgra ASC";
$rsPrograSabado = mysql_query($query_rsPrograSabado, $juventud) or die(mysql_error());
$row_rsPrograSabado = mysql_fetch_assoc($rsPrograSabado);
$totalRows_rsPrograSabado = mysql_num_rows($rsPrograSabado);

mysql_select_db($database_juventud, $juventud);
$query_rsPrograDomingo = "SELECT prograID, diaProgra, horaProgra, generoProgra FROM programacion WHERE diaProgra = 'Domingo' ORDER BY horaProgra ASC";
$rsPrograDomingo = mysql_query($query_rsPrograDomingo, $juventud) or die(mysql_error());
$row_rsPrograDomingo = mysql_fetch_assoc($rsPrograDomingo);
$totalRows_rsPrograDomingo = mysql_num_rows($rsPrograDomingo);

mysql_select_db($database_juventud, $juventud);
$query_Recordset1 = "SELECT txtAnun FROM anuncios ORDER BY anunID DESC";
$Recordset1 = mysql_query($query_Recordset1, $juventud) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

$maxRows_rsAnunConImg = 5;
$pageNum_rsAnunConImg = 0;
if (isset($_GET['pageNum_rsAnunConImg'])) {
  $pageNum_rsAnunConImg = $_GET['pageNum_rsAnunConImg'];
}
$startRow_rsAnunConImg = $pageNum_rsAnunConImg * $maxRows_rsAnunConImg;

mysql_select_db($database_media, $media);
$query_rsAnunConImg = "SELECT * FROM media ORDER BY ID DESC";
$query_limit_rsAnunConImg = sprintf("%s LIMIT %d, %d", $query_rsAnunConImg, $startRow_rsAnunConImg, $maxRows_rsAnunConImg);
$rsAnunConImg = mysql_query($query_limit_rsAnunConImg, $media) or die(mysql_error());
$row_rsAnunConImg = mysql_fetch_assoc($rsAnunConImg);

if (isset($_GET['totalRows_rsAnunConImg'])) {
  $totalRows_rsAnunConImg = $_GET['totalRows_rsAnunConImg'];
} else {
  $all_rsAnunConImg = mysql_query($query_rsAnunConImg);
  $totalRows_rsAnunConImg = mysql_num_rows($all_rsAnunConImg);
}
$totalPages_rsAnunConImg = ceil($totalRows_rsAnunConImg/$maxRows_rsAnunConImg)-1;
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="Keywords" content="radiovj, gospel, sv" />
<meta name="Description" content="Radio Juvenil Espiritu de Vida, El Salvador, C.A." />
<title>Radio Juventud Espiritu de Vida</title>
<link href="../css/indexRadio.css" rel="stylesheet" type="text/css" media="screen">
<link href="../css/SlideShowCSS.css" rel="stylesheet" type="text/css" media="screen">
<meta property="fb:admins" content="{nahum.galvez,juventudespiritudevida}"/>
<script src="../SpryAssets/SpryAccordion.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="../js/slides.min.jquery.js"></script>

<script>
		$(function(){
			$('#slides').slides({
				preload: true,
				preloadImage: 'img/loading.gif',
				play: 5000,
				pause: 2500,
				hoverPause: true,
				animationStart: function(current){
					$('.caption').animate({
						bottom:-35
					},100);
					if (window.console && console.log) {
						// example return of current slide number
						console.log('animationStart on slide: ', current);
					};
				},
				animationComplete: function(current){
					$('.caption').animate({
						bottom:0
					},200);
					if (window.console && console.log) {
						// example return of current slide number
						console.log('animationComplete on slide: ', current);
					};
				},
				slidesLoaded: function() {
					$('.caption').animate({
						bottom:0
					},200);
				}
			});
		});
	</script>


</head>
<body>
<div id="contenedor">
			<header id="cabecera">
                    <p class="bienvenida">Bienvenido a <br />Radio Juvenil Espíritu de Vida</p>
            </header>    
		<div id="panelIzq">
            <div id="playerDiv">
             	<div id="txtCanciones">
                	<p>Canción: <span id="cc_strinfo_tracktitle_cromerol" class="cc_streaminfo">...Cargando...</span></p>
                	<p>Artista: <span id="cc_strinfo_trackartist_cromerol" class="cc_streaminfo">...Cargando...</span></p>
                </div>
            	<div id="playerFlash"></div>
            </div>
            <div id="chat">
             	<div id="comments" class="fb-comments" data-href="http://vidajuvenil.com/radio" data-width="558" data-num-posts="6", order_by="reverse_time"></div>
            </div>
        </div><!-- Fin de panel Izquierdo-->
        
		<div id="panelDer">
        	<div id="social">
              <?php if ($totalRows_rsAnunConImg > 0) { // Show if recordset not empty ?>
  <div id="anuncios">
    <div id="slides">
      <div class="slides_container">
        <?php do { ?>
          <div class="slide">
            <img src="../media/anuncios/<?php echo $row_rsAnunConImg['nombrearchivo']; ?>" width="370" height="200">
            <div class="caption" style="bottom:0"><span><strong><?php echo $row_rsAnunConImg['descriptions']; ?></strong></span></div>
          </div>
          <?php } while ($row_rsAnunConImg = mysql_fetch_assoc($rsAnunConImg)); ?>
      </div>
      
    </div>
  </div>
  <?php } // Show if recordset not empty ?>
<div id="likebotton" class="fb-like" data-href="http://vidajuvenil.com/radio" data-send="true" data-width="365" data-show-faces="true" data-font="segoe ui"></div>
            </div>
            <div id="programacion">
              <div id="ProgramacionMenu" class="Accordion" tabindex="0">
                <div class="AccordionPanel">
                  <div class="AccordionPanelTab">Lunes</div>
                  <div class="AccordionPanelContent">
                  		<div id="programacionDia">
                        <?php if ($totalRows_rsPrograLunes == 0) { // Show if recordset empty ?>
  <span>No hay programacion que mostrar.</span>
  <?php } // Show if recordset empty ?>
  <?php if ($totalRows_rsPrograLunes > 0) { // Show if recordset not empty ?>
    						<div class="horaDiv"><p>Hora</p></div><div class="generoDiv"><p>Género</p></div><div style="clear:both"></div>
                              <marquee direction="up" behavior="scroll" align="middle" height="150" scrollamount="2" loop="-1">
                                <?php do { ?>
                                  <div class="txtPrograDiaL"><?php echo $row_rsPrograLunes['horaProgra']; ?></div>
                                  <div class="txtPrograGenero"><?php echo $row_rsPrograLunes['generoProgra']; ?></div>
                                  <hr align="center" width="90%">
                                  <?php } while ($row_rsPrograLunes = mysql_fetch_assoc($rsPrograLunes)); ?>
                            </marquee>
                              <?php } // Show if recordset not empty ?>
                        </div>		
                  </div>
                </div>
                <div class="AccordionPanel">
                  <div class="AccordionPanelTab">Martes</div>
                  <div class="AccordionPanelContent">
                  <div id="programacionDia">
    						<?php if ($totalRows_rsPrograMartes == 0) { // Show if recordset empty ?>
  <span>No hay programacion que mostrar.</span>
  <?php } // Show if recordset empty ?>
                            <?php if ($totalRows_rsPrograMartes > 0) { // Show if recordset not empty ?><div class="horaDiv"><p>Hora</p></div><div class="generoDiv"><p>Género</p></div><div style="clear:both"></div>
                              <marquee direction="up" behavior="scroll" align="middle" height="150" scrollamount="2" loop="-1">
                                <?php do { ?>
                                  <div class="txtPrograDiaL"><?php echo $row_rsPrograMartes['horaProgra']; ?></div>
                                  <div class="txtPrograGenero"><?php echo $row_rsPrograMartes['generoProgra']; ?></div>
                                  <hr align="center" width="90%">
                                  <?php } while ($row_rsPrograMartes = mysql_fetch_assoc($rsPrograMartes)); ?>
                            </marquee>
                              <?php } // Show if recordset not empty ?>
                  </div>		
                  </div>
                </div>
                <div class="AccordionPanel">
                  <div class="AccordionPanelTab">Miércoles</div>
                  <div class="AccordionPanelContent">
                  	<div id="programacionDia">
    						<?php if ($totalRows_rsPrograMiercoles == 0) { // Show if recordset empty ?>
  <span>No hay programacion que mostrar.</span>
  <?php } // Show if recordset empty ?>
                            <?php if ($totalRows_rsPrograMiercoles > 0) { // Show if recordset not empty ?><div class="horaDiv"><p>Hora</p></div><div class="generoDiv"><p>Género</p></div><div style="clear:both"></div>
                              <marquee direction="up" behavior="scroll" align="middle" height="150" scrollamount="2" loop="-1">
                                <?php do { ?>
                                  <div class="txtPrograDiaL"><?php echo $row_rsPrograMiercoles['horaProgra']; ?></div>
                                  <div class="txtPrograGenero"><?php echo $row_rsPrograMiercoles['generoProgra']; ?></div>
                                  <hr align="center" width="90%">
                                  <?php } while ($row_rsPrograMiercoles = mysql_fetch_assoc($rsPrograMiercoles)); ?>
                            </marquee>
                              <?php } // Show if recordset not empty ?>
                    </div>		
                  </div>
                </div>
                <div class="AccordionPanel">
                  <div class="AccordionPanelTab">Jueves</div>
                  <div class="AccordionPanelContent">
                  <div id="programacionDia">
    						<?php if ($totalRows_rsPrograJueves == 0) { // Show if recordset empty ?>
  <span>No hay programacion que mostrar.</span>
  <?php } // Show if recordset empty ?>
                            <?php if ($totalRows_rsPrograJueves > 0) { // Show if recordset not empty ?><div class="horaDiv"><p>Hora</p></div><div class="generoDiv"><p>Género</p></div><div style="clear:both"></div>
                              <marquee direction="up" behavior="scroll" align="middle" height="150" scrollamount="2" loop="-1">
                                <?php do { ?>
                                  <div class="txtPrograDiaL"><?php echo $row_rsPrograJueves['horaProgra']; ?></div>
                                  <div class="txtPrograGenero"><?php echo $row_rsPrograJueves['generoProgra']; ?></div>
                                  <hr align="center" width="90%">
                                  <?php } while ($row_rsPrograJueves = mysql_fetch_assoc($rsPrograJueves)); ?>
                            </marquee>
                              <?php } // Show if recordset not empty ?>
                  </div>		
                  </div>
                </div>
                <div class="AccordionPanel">
                  <div class="AccordionPanelTab">Viernes</div>
                  <div class="AccordionPanelContent"><div id="programacionDia">
    						<?php if ($totalRows_rsPrograViernes == 0) { // Show if recordset empty ?>
  <span>No hay programacion que mostrar.</span>
  <?php } // Show if recordset empty ?>
                            <?php if ($totalRows_rsPrograViernes > 0) { // Show if recordset not empty ?><div class="horaDiv"><p>Hora</p></div><div class="generoDiv"><p>Género</p></div><div style="clear:both"></div>
                              <marquee direction="up" behavior="scroll" align="middle" height="150" scrollamount="2" loop="-1">
                                <?php do { ?>
                                  <div class="txtPrograDiaL"><?php echo $row_rsPrograViernes['horaProgra']; ?></div>
                                  <div class="txtPrograGenero"><?php echo $row_rsPrograViernes['generoProgra']; ?></div>
                                  <hr align="center" width="90%">
                                  <?php } while ($row_rsPrograViernes = mysql_fetch_assoc($rsPrograViernes)); ?>
                            </marquee>
                              <?php } // Show if recordset not empty ?>
                  </div>		</div>
                </div>
                <div class="AccordionPanel">
                  <div class="AccordionPanelTab">Sábado</div>
                  <div class="AccordionPanelContent"><div id="programacionDia">
    						<?php if ($totalRows_rsPrograSabado == 0) { // Show if recordset empty ?>
  <span>No hay programacion que mostrar.</span>
  <?php } // Show if recordset empty ?>
                            <?php if ($totalRows_rsPrograSabado > 0) { // Show if recordset not empty ?><div class="horaDiv"><p>Hora</p></div><div class="generoDiv"><p>Género</p></div><div style="clear:both"></div>
                              <marquee direction="up" behavior="scroll" align="middle" height="150" scrollamount="2" loop="-1">
                                <?php do { ?>
                                  <div class="txtPrograDiaL"><?php echo $row_rsPrograSabado['horaProgra']; ?></div>
                                  <div class="txtPrograGenero"><?php echo $row_rsPrograSabado['generoProgra']; ?></div>
                                  <hr align="center" width="90%">
                                  <?php } while ($row_rsPrograSabado = mysql_fetch_assoc($rsPrograSabado)); ?>
                            </marquee>
                              <?php } // Show if recordset not empty ?>
                  </div>		</div>
                  </div>
                <div class="AccordionPanel">
                  <div class="AccordionPanelTab">Domingo</div>
                  <div class="AccordionPanelContent"><div id="programacionDia">
    						<?php if ($totalRows_rsPrograDomingo == 0) { // Show if recordset empty ?>
  <span>No hay programacion que mostrar.</span>
  <?php } // Show if recordset empty ?>
                            <?php if ($totalRows_rsPrograDomingo > 0) { // Show if recordset not empty ?><div class="horaDiv"><p>Hora</p></div><div class="generoDiv"><p>Género</p></div><div style="clear:both"></div>
  <marquee direction="up" behavior="scroll" align="middle" height="150" scrollamount="2" loop="-1"><?php do { ?>
    <div class="txtPrograDiaL"><?php echo $row_rsPrograDomingo['horaProgra']; ?></div><div class="txtPrograGenero"><?php echo $row_rsPrograDomingo['generoProgra']; ?></div><hr align="center" width="90%">
    <?php } while ($row_rsPrograDomingo = mysql_fetch_assoc($rsPrograDomingo)); ?></marquee>
  <?php } // Show if recordset not empty ?>
                  </div>
                      </div>
              </div>
            </div>
  </div>
          <div style="clear:both"></div>
</div><!-- Fin de panel Derecho-->
</div>
<script type="text/javascript">
var Accordion1 = new Spry.Widget.Accordion("ProgramacionMenu");
</script>

<script type="text/javascript" src="http://www.hostingmembercenter.com/freeflashplayer/player/swfobject.js"></script>
<script language="javascript" type="text/javascript" src="http://cp.eu1.fastcast4u.com/system/streaminfo.js"></script>
<script type="text/javascript">
var s1 = new SWFObject('http://www.hostingmembercenter.com/freeflashplayer/player/player.swf',
'player',"490","32","9","#FFFFFF");
s1.addParam("allowfullscreen","false");
s1.addParam("allowscriptaccess","always");
s1.addParam("flashvars","skin=http://www.hostingmembercenter.com/freeflashplayer/skins/modieus.swf&title=Live Stream&type=sound&file=http://5.63.146.244:11402/;stream.mp3&13202692901&duration=99999&id=scplayer&autostart=false");
s1.write("playerFlash");
		</script>

<script>(//facebook
		  function(d, s, id) {
		  var js, fjs = d.getElementsByTagName(s)[0];
		  if (d.getElementById(id)) return;
		  js = d.createElement(s); js.id = id;
		  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
		  fjs.parentNode.insertBefore(js, fjs);
		}(document, 'script', 'facebook-jssdk'));</script>

</body>
</html>
<?php
mysql_free_result($rsPrograLunes);

mysql_free_result($rsPrograMartes);

mysql_free_result($rsPrograMiercoles);

mysql_free_result($rsPrograJueves);

mysql_free_result($rsPrograViernes);

mysql_free_result($rsPrograSabado);

mysql_free_result($rsPrograDomingo);

mysql_free_result($Recordset1);

mysql_free_result($rsAnunConImg);
?>
